{% extends 'bugs/base.html' %}
{% load staticfiles %}
{% block content %}
    <div class="panel panel-default" id="numcon">
        <div class="panel-body">
            <form action="/update_user/" method="post" class="form-horizontal"
                  style="margin-right:40px;">
                {% csrf_token %}
                {% if user_data %}
                    {% for data in user_data %}
                        <div class="form-group">
                            <label for="inputPassword3" class="col-sm-2 control-label">工號</label>
                            <div class="col-sm-10">
                                <input type="text" class="form-control" id="userid" name="userid" readonly
                                       value={{ data.user_id }}>
                            </div>
                        </div>
                        <br>
                        <div class="form-group">
                            <label for="inputEmail3" class="col-sm-2 control-label">姓名</label>
                            <div class="col-sm-10">
                                <input type="text" class="form-control" id="c_name" name="c_name" readonly
                                       value={{ data.c_name }}>
                            </div>
                        </div>
                        <br>
                        <div class="form-group">
                            <label for="inputEmail3" class="col-sm-2 control-label">英文名</label>
                            <div class="col-sm-10">
                                <input type="text" class="form-control" id="e_name" name="e_name" readonly
                                       value={{ data.e_name }}>
                            </div>
                        </div>
                        <br>
                        <div class="form-group">
                            <label for="inputEmail3" class="col-sm-2 control-label">密碼</label>
                            <div class="col-sm-10">
                                <input type="text" class="form-control" id="password" name="password"
                                       value={{ data.password }}>
                            </div>
                        </div>
                        <br>
                        <div class="form-group">
                            <label for="inputPassword3" class="col-sm-2 control-label">權限</label>
                            <div class="col-sm-10">
                                <select class="form-control" name="authority">
                                    <option {% ifequal data.authority '1' %}selected{% endifequal %}>admin
                                    </option>
                                    <option {% ifequal data.authority '2' %}selected{% endifequal %}>engineer
                                    </option>
                                    <option {% ifequal data.authority '3' %}selected{% endifequal %}>user
                                    </option>
                                </select>
                            </div>
                        </div>
                        <br>
                        <div class="form-group">
                            <label for="inputPassword3" class="col-sm-2 control-label">分机号</label>
                            <div class="col-sm-10">
                                <input type="phone" class="form-control" name="phone" id="phone"
                                       placeholder="phone" value="{{ data.phone }}">
                            </div>
                        </div>
                        <br>
                        <div class="form-group">
                            <label for="inputPassword3" class="col-sm-2 control-label">Team</label>
                            <!--#:此处页面上没有显示数据-->
                            <div class="col-sm-10">
                                <input type="text" class="form-control" id="team" name="team"
                                       value={{ data.team }}>
                            </div>
                        </div>
                    {% endfor %}
                    <br>
                    <div class="form-group">
                        <div class="col-sm-offset-4 col-sm-10">
                            <button id="btn_01" type="submit" class="btn btn-primary btn-lg"><p
                                    style="margin:0 0 0 0;font-size:17px;font-weight:bold;font-family:'微软雅黑'">
                                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;確&nbsp;&nbsp;&nbsp;認&nbsp;&nbsp;修 改&nbsp;&nbsp;&nbsp;&nbsp;</p>
                            </button>
                        </div>
                    </div>
                {% endif %}
            </form>
        </div>
    </div>
{% endblock %}